/*  -*- mode: c++; coding: utf-8; c-file-style: "stroustrup"; -*-

    Copyright 2008 Asier Aguirre <asier.aguirre@gmail.com>
    This file is part of Intromit.

    Intromit is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Intromit is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Intromit.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef RENDER_OBJ_CUBE_HH
#define RENDER_OBJ_CUBE_HH
//! \addtogroup introsight_framework
//@{

// INCLUDES
#include "render_obj.hh"
#include "render_attr.hh"

class render_mng;

class render_obj_cube: public render_obj
{
    // cube specification
    float dims[IS_3D];
    bool spin;

    // color changes
    render_color_anim color;
    unsigned char color_nonselect[IS_RGBA];
    unsigned char color_select[IS_RGBA];
    unsigned char color_cselect[IS_RGBA];
    unsigned color_anim_usec;

    // PRIVATE METHODS
    void ctor();
    void dtor();

    // render functions
    void render_cube();
    void render_cube_complete();
    void render_modifier(bool select);

    // event queue callback
    static int event_queue_callback(render_obj_cube *obj, render_mng *ctx);

public:
    render_obj_cube();
    virtual ~render_obj_cube();

    virtual bool init(render_mng *ctx);
    virtual void render(render_mng *ctx);
    virtual bool event(render_mng *ctx);
    virtual unsigned get_type();           // returns IS_TYPE_*

    void set_spin(bool set, render_mng *ctx);
};

//@}
#endif

/* Offline metadata attributes:

   @metadata_attrs(
	render_obj_cube
	{
		# members
		dims, spin,
		color,
		color_nonselect,
		color_select,
		color_cselect,
		color_anim_usec:
		
						select

		# methods
		init, render, set_spin:
						select
	}
   )
*/
